﻿using Sidvall.WorkItemManager.Data;
using System.Collections.Generic;
using System.Linq;

namespace Sidvall.WorkItemManager.UI.Entities
{
	public sealed partial class MonitoredWorkItemCollection
	{
		#region Public Members

		#region LoadDescription

		public void LoadDescription(IEnumerable<IWorkItem> workItems)
		{
			if (workItems == null)
				return;
			foreach (var item in this)
			{
				var workItem = (from o in workItems
								where o.WorkItemId == item.WorkItemId
								select o).FirstOrDefault();
				if (workItem != null)
					item.Description = workItem.Name;
			}
		}

		#endregion

		#endregion
	}
}